/**
 * 报表设计公司(2011)
 */
package com.reportgear.designer.action.file;

import java.util.EventObject;

import net.abbp.report.model.ReportModel;
import net.abbp.swing.util.ImageUtils;

import com.reportgear.core.swing.pane.base.JBaseDialog;
import com.reportgear.designer.action.UndoableAction;
import com.reportgear.report.print.pane.PageSetupPane;

/**
 * 页面设置
 * 
 * @version 1.0 2011-3-24
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since ANNCSR 2.0
 */
public class PageSetupAction extends UndoableAction {

	public PageSetupAction() {
		setName("页面设置");
		setSmallIcon(ImageUtils.readIcon("file/page-setup.png"));
	}

	@Override
	public boolean executeAction(EventObject evt) {
		ReportModel model = this.getGridView().getReportModel();
		PageSetupPane psp = new PageSetupPane();
		psp.populate(model);

		int result = psp.showDialog(null);
		
		if(result == JBaseDialog.RESULT_OK){
			psp.update(model);
		}
		
		return true; 
	}
}